package com.ctosb.classviewer.clazz.attr.frame;

import com.ctosb.classviewer.ClassReader;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class Append_frame extends BaseFrame {

    /* APPEND 252-254 */

    private short offset_delta;
    private Verification_type_info stack[]; /* frame_type - 251 */

    @Override
    protected void doParse(ClassReader classReader) {
        this.offset_delta = classReader.readShort();
        stack = new Verification_type_info[(getFrame_type() & 0xff) - 251];
        for (int i = 0; i < stack.length; i++) {
            stack[i] = new Verification_type_info().parse(classReader, getClassFile());
        }
    }
}
